Click or drag to resize

ResourceListWithProperties Method (String, PropertyName, Boolean)

Note: This API is now obsolete.

Displays a list of subresources and their name and properties.

Namespace:  Independentsoft.Webdav
Assembly:  Independentsoft.Webdav (in Independentsoft.Webdav.dll) Version: 1.0.700.18437
Syntax
[ObsoleteAttribute("Will be removed in next version. Use method List.")]
public string[,] ListWithProperties(
	string address,
	PropertyName[] propertyName,
	bool recursive
)

Parameters

address
Type: SystemString
The URI that identifies the collection.
propertyName
Type: Independentsoft.WebdavPropertyName
Properties to display.
recursive
Type: SystemBoolean
If true returns resources in this collection and all subcollections.

Return Value

Type: String
Two-dimension array of strings. The "first dimension" is number of returned resources, and the "secound dimension" is number of requested properties plus one.
Remarks
This method returns names and requested properties values of subresources in collection.
Examples
The following example shows how to call the ListWithProperties method.
 using System;
 using Independentsoft.Webdav;

 class List
 {
    [STAThread]
    static void Main(string[] args)
    {
        Resource resource = new Resource("http://localhost/dav");

        //Creates requested property names.
        PropertyName propertyName1 = new PropertyName("getcontentlength","DAV:");
        PropertyName propertyName2 = new PropertyName("resourcetype","DAV:");
        PropertyName propertyName3 = new PropertyName("getlastmodified","DAV:");

        PropertyName[] attributes = new PropertyName[3];

        attributes[0] = propertyName1;
        attributes[1] = propertyName2;
        attributes[2] = propertyName3;

        //Calls the method.
        string[,] list = resource.ListWithProperties(attributes);

        for(int i=0;i list.GetLength(0);i++)
        {
            string name = list[i,0];
            string size = list[i,1];
            string type = list[i,2];
            string date = list[i,3];

            Console.WriteLine(name + " " + size + " " + type + " " + date);
        }

        //Wait for "return" to exit.
        Console.Read();
    }
}
See Also